package com.zoo.diannaopeijian.mapper;

import com.zoo.diannaopeijian.domain.Component;
import com.zoo.diannaopeijian.domain.ComponentExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface ComponentMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table component
     *
     * @mbggenerated
     */
    @SelectProvider(type=ComponentSqlProvider.class, method="countByExample")
    int countByExample(ComponentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table component
     *
     * @mbggenerated
     */
    @DeleteProvider(type=ComponentSqlProvider.class, method="deleteByExample")
    int deleteByExample(ComponentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table component
     *
     * @mbggenerated
     */
    @Delete({
        "delete from component",
        "where ComponentId = #{componentid,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer componentid);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table component
     *
     * @mbggenerated
     */
    @Insert({
        "insert into component (ComponentId, ComponentName)",
        "values (#{componentid,jdbcType=INTEGER}, #{componentname,jdbcType=VARCHAR})"
    })
    int insert(Component record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table component
     *
     * @mbggenerated
     */
    @InsertProvider(type=ComponentSqlProvider.class, method="insertSelective")
    int insertSelective(Component record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table component
     *
     * @mbggenerated
     */
    @SelectProvider(type=ComponentSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="ComponentId", property="componentid", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="ComponentName", property="componentname", jdbcType=JdbcType.VARCHAR)
    })
    List<Component> selectByExample(ComponentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table component
     *
     * @mbggenerated
     */
    @Select({
        "select",
        "ComponentId, ComponentName",
        "from component",
        "where ComponentId = #{componentid,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="ComponentId", property="componentid", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="ComponentName", property="componentname", jdbcType=JdbcType.VARCHAR)
    })
    Component selectByPrimaryKey(Integer componentid);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table component
     *
     * @mbggenerated
     */
    @UpdateProvider(type=ComponentSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Component record, @Param("example") ComponentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table component
     *
     * @mbggenerated
     */
    @UpdateProvider(type=ComponentSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Component record, @Param("example") ComponentExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table component
     *
     * @mbggenerated
     */
    @UpdateProvider(type=ComponentSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Component record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table component
     *
     * @mbggenerated
     */
    @Update({
        "update component",
        "set ComponentName = #{componentname,jdbcType=VARCHAR}",
        "where ComponentId = #{componentid,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Component record);
}